package com.wiloon.java8x.basic;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.management.ManagementFactory;

/**
 * Created by roy on 4/25/17;
 */
public class Java8xUtils {
    private static Logger logger = LoggerFactory.getLogger(Java8xUtils.class);

    public static String pid() {
        String name = ManagementFactory.getRuntimeMXBean().getName();
        // get pid
        String pid = name.split("@")[0];
        logger.info("PID:{}", pid);
        return pid;
    }
}
